﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace iNet.Collections
{
	/// <summary>
	/// 表示不會列舉任何元素的列舉器。
	/// </summary>
	/// <typeparam name="T">元素型別。</typeparam>
	public class EmptyEnumerator<T> : IEnumerator<T>
	{
		#region 建構子
		/// <summary>
		/// 初始化新的 EmptyEnumerator 執行個體。
		/// </summary>
		public EmptyEnumerator()
		{ }
		#endregion
		#region IDisposable.Dispose
		void IDisposable.Dispose()
		{ }
		#endregion
		#region IEnumerator.Current
		object IEnumerator.Current
		{
			get
			{
				throw new InvalidOperationException();
			}
		}
		#endregion
		#region IEnumerator.MoveNext
		bool IEnumerator.MoveNext()
		{
			return false;
		}
		#endregion
		#region IEnumerator.Reset
		void IEnumerator.Reset()
		{ }
		#endregion
		#region IEnumerator<T>.Current
		T IEnumerator<T>.Current
		{
			get
			{ 
				throw new InvalidOperationException();
			}
		}
		#endregion
	}
}
